package com.bdzl.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Clause entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "clause", catalog = "bdzl")
public class Clause  {

	// Fields

	private Integer id;
	private Company company; //所属公司ID
	private Integer type;//1意外保障  2 重疾保障  3医疗保障   4身价保障  5 理财 教育 养老
	private String number;//条款编号
	private String name;//条款名称
	private String searchName;//搜索名称（例：福禄备至  flbz）
	private String address;//文本下载地址
	private String additionals;//所有附加险ID（中间，区分）
	private Integer state;//0删除 1显示 
	private Integer main;//0附加险 1主险
	private Long time;//添加时间.
	private Integer userId;//操作人ID
	private Long endTime;//删除时间
	private Integer endUser;//删除管理员ID
	private Integer clickNum;//热度点击次数
	private Set<Fund> funds = new HashSet<Fund>(0);
	private Set<Illness> illnesses = new HashSet<Illness>(0);
	private Set<Worths> worthses = new HashSet<Worths>(0);
	private Set<Health> healths = new HashSet<Health>(0);
	private Set<Accident> accidents = new HashSet<Accident>(0);

	// Constructors

	/** default constructor */
	public Clause() {
	}

	/** full constructor */
	public Clause(Company company, Integer type, String number, String name,
			String searchName, String address, String additionals,
			Integer state, Integer main, Long time, Integer userId,
			Long endTime, Set<Fund> funds, Set<Illness> illnesses,
			Set<Worths> worthses, Set<Health> healths, Set<Accident> accidents) {
		this.company = company;
		this.type = type;
		this.number = number;
		this.name = name;
		this.searchName = searchName;
		this.address = address;
		this.additionals = additionals;
		this.state = state;
		this.main = main;
		this.time = time;
		this.userId = userId;
		this.endTime = endTime;
		this.funds = funds;
		this.illnesses = illnesses;
		this.worthses = worthses;
		this.healths = healths;
		this.accidents = accidents;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "company_id")
	public Company getCompany() {
		return this.company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	@Column(name = "type")
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "number")
	public String getNumber() {
		return this.number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "search_name")
	public String getSearchName() {
		return this.searchName;
	}

	public void setSearchName(String searchName) {
		this.searchName = searchName;
	}

	@Column(name = "address")
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "additionals")
	public String getAdditionals() {
		return this.additionals;
	}

	public void setAdditionals(String additionals) {
		this.additionals = additionals;
	}

	@Column(name = "state")
	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Column(name = "main")
	public Integer getMain() {
		return this.main;
	}

	public void setMain(Integer main) {
		this.main = main;
	}

	@Column(name = "time")
	public Long getTime() {
		return this.time;
	}

	public void setTime(Long time) {
		this.time = time;
	}

	@Column(name = "user_id")
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "end_time")
	public Long getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Long endTime) {
		this.endTime = endTime;
	}

	@Column(name = "end_user")
	public Integer getEndUser() {
		return endUser;
	}

	public void setEndUser(Integer endUser) {
		this.endUser = endUser;
	}
	@Column(name = "click_num")
	public Integer getClickNum() {
		return clickNum;
	}

	public void setClickNum(Integer clickNum) {
		this.clickNum = clickNum;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "clause")
	public Set<Fund> getFunds() {
		return this.funds;
	}

	public void setFunds(Set<Fund> funds) {
		this.funds = funds;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "clause")
	public Set<Illness> getIllnesses() {
		return this.illnesses;
	}

	public void setIllnesses(Set<Illness> illnesses) {
		this.illnesses = illnesses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "clause")
	public Set<Worths> getWorthses() {
		return this.worthses;
	}

	public void setWorthses(Set<Worths> worthses) {
		this.worthses = worthses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "clause")
	public Set<Health> getHealths() {
		return this.healths;
	}

	public void setHealths(Set<Health> healths) {
		this.healths = healths;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "clause")
	public Set<Accident> getAccidents() {
		return this.accidents;
	}

	public void setAccidents(Set<Accident> accidents) {
		this.accidents = accidents;
	}

}